package kjd;

import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 * Illustrates JUnit testing. Tests the ability for Math Random function randomness when modified
 * for robocode angles. Based on file provided by Philip Johnson. Modified for GunAryos and kjd
 * package.
 * 
 * @author Philip Johnson, Kendyll Doi
 * 
 */
public class TestGunAryosRandomAngles {
  
  /**
   * Tests the random angle calculations is within the range for a wall hit with GunAryos.
   */
  @Test
  public void testRandomWallHit() {
    double test1 = 180 + Math.random() * 90;
    assertTrue("Random function generating same results", test1 > 0 && test1 < 270);
  }

  /**
   * Tests the random angle calculations is within the range for a bullet hit with GunAryos.
   */
  @Test
  public void testRandomDodge() {
    double test1 = 45 + Math.random() * 45;
    assertTrue("Random function generating same results", test1 > 0 && test1 < 90);
  }
}
